from django.shortcuts import render
from rest_framework.response import Response
from rest_framework.views import APIView

from menus.models import Menu
from menus.serializers import MenuSerializer


# Create your views here.
class MenusView(APIView):
    def get(self, request):
        serializer = MenuSerializer(Menu.objects.all().filter(parent=None), many=True)
        return Response(data=serializer.data)